<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateCommentsTable extends Migrator
{
    public function up()
    {
        $this->table('comments')
            ->addColumn('post_id', 'integer')
            ->addColumn('content', 'string', ['limit' => 255, 'comment' => '评论内容'])
            ->addColumn('status', 'integer', ['default' => -1, 'comment' => '状态-1拒绝9审核通过1等待审核'])
            ->addColumn('create_time', 'timestamp')
            ->save();
    }

    public function down()
    {
        $this->dropTable('comments');
    }
}
